package com.lhr.common.util;

import java.util.Date;
import java.util.Random;
import java.util.UUID;


public class KeyUtil {

	public static String getUUID(boolean isUpperCase) {
		String uuid = UUID.randomUUID().toString().replace("-", "");
		if (isUpperCase == false)
			return uuid;
		return uuid.toUpperCase();
	}

	public static String getUUID() {
		return getUUID(false);
	}

	public static String getTimeKey(Date date) {
		int random = new Random().nextInt(10);
		return String.valueOf(date.getTime()) + random;
	}

	public static String getTimeKey() {
		return getTimeKey(new Date());
	}
}
